home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 202 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: assembler in borland C 4.5
  5. Date: 2 Jan 1996 22:41:40 GMT
  6. Organization: Pipeline USA
  7. Message-ID: <4cccb4$6kg@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe6.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Jan 02, 1996 14:08:40 in article <assembler in borland C 4.5>, 'Per
  15. Wiberg <e95_pwi@elixir.e.kth.se>' wrote: 
  16.  
  17.  
  18. >Well.. I got a CD with a lot of programs from my school (KTH in 
  19. >stockholm) and among them BC4.5. AND no manual, reference-book or 
  20. >anything!. 
  21. >"lucky-me" I've got no CD-ROM drive! ... so I made my friend raw-copy 
  22. >BC4.5 on to floppy's (bad idea!). And here I am with a silly question: 
  23. Hmm, I don'w see what the above has to do with the question. 
  24.  
  25. >- how do you include assembler code in BC4.5 ? 
  26.  
  27. If you mean inline assembly (which is only a subset of ASM), it goes 
  28. something like this: 
  29.  
  30. int Foo (int n) 
  31.  { 
  32.    asm { 
  33.             mov   ax,n 
  34.             add   ax,5 
  35.         } 
  36.  } 
  37.  
  38. Some not-so-apparent rules are: 
  39.    the enclosed braces (at least the first one) must be on a line 
  40.    that doesn't contain any ASM directives. 
  41.   There's restrictions on comments.  I don't remember the rules 
  42. but to be safe, don't use any. 
  43. If you make errors, the compiler sometimes reports errors in 
  44. a completely different place from the actual error and the message 
  45. is gobbdleygook -- moral:  Don't make any errors in your asm code. :-) 
  46.  
  47. -- 
  48.  
  49. Pete
  50.